package net.sansi.v3correctserver.interceptor;

import lombok.extern.slf4j.Slf4j;
import net.sansi.v3correctserver.constenum.ThreadLocalValues;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Fang
 * create time : 2024/2/2
 * IDE : IntelliJ IDEA
 * <p>
 * 项目拦截器
 */

@Slf4j
@Component
public class ProjectInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        ThreadLocalValues.instance.setRequestHeaders(request);
        return true;
    }
}
